import React from 'react';
import classNames from 'classnames';

export class Tabs extends React.Component {
  render() {
    return (
      <div className="tabs-order">
        {/* 类on选中效果 */}
        {this.props.tabs.map((item) => {
          return (
            <div
              // className={item.type === this.state.active ? 'on' : ''}
              className={classNames({
                on: item.type === this.props.active,
              })}
              key={item.id}
              onClick={() => {
                return this.props.changeSortType(item.type);
              }}
            >
              按{item.name}排序
            </div>
          );
        })}
      </div>
    );
  }
}
